package my.test;

import com.yuhang.demo.util.PostUtil;
import org.apache.http.NameValuePair;

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author yuhang
 * @desc
 * @since 2022/4/6
 */
public class CloudTes {


    private static String api = "http://127.0.0.1:8090";
//   private static String api="http://material.ximgs.net";
    public static void main(String[] args) throws Exception {

//        String result =pageList();
        long a=System.currentTimeMillis();
        String result = productPageList();
//        String result = detail();

        System.out.println(System.currentTimeMillis()-a);
        System.out.println(result);
    }
    private static String detail() throws Exception {
        String url = api + "/api/product/detail";
        Map<String,Object> params =new HashMap<>();
        params.put("productId",10);
        return PostUtil.httpCloudJSON(url, params);
    }
    private static String pageList() throws Exception {
        String url = api + "/api/admin/order/pageList";
        Map<String,Object> params =new HashMap<>();
        params.put("optType","");
        params.put("status","");
        params.put("supplierName","");
        params.put("tag","");
        return PostUtil.httpCloud(url, params);
    }


    private static String productPageList() throws Exception {
        String url = api + "/api/product/pageList";
        Map<String,Object> params =new HashMap<>();
//        params.put("tag",0);
        params.put("pageNo",1);
        return PostUtil.httpCloudJSON(url, params);
    }
}
